
#include "ThreadPool.hpp"
#include <memory>
#include "Task.hpp"
using namespace std;
using namespace ThreadPoolModule;

int main()
{
  // ENABLE_FILE_LOG();
  ENABLE_CONSOLE_LOG();
  ThreadPool<task_t>::getInstance()->Start();
  int cnt = 10;
  while (cnt)
  {
    ThreadPool<task_t>::getInstance()->Enqueue(Push); // 线程池任务入队列
    cnt--;
    sleep(1);
  }
  ThreadPool<task_t>::getInstance()->Stop();
  ThreadPool<task_t>::getInstance()->Wait();

  // unique_ptr<ThreadPool<task_t>> tp = make_unique<ThreadPool<task_t>>();
  // tp->Start(); // 线程池启动

  // tp->Stop(); //线程池停止
  // sleep(3);
  // tp->Wait(); //线程回收
  return 0;
}
